﻿using System;
using LibDBConnect;

namespace LibDataLayer
{
    public class DalUsersInfo
    {
        private static readonly SqlHelper Cls = new SqlHelper();
        #region[Insert-Update-Delete]
        public static bool Update(DTOUsersInfo obj)
        {
            Cls.CreateNewSqlCommand();
            Cls.AddParameter("UserId", obj.UserId);
            Cls.AddParameter("UTitle", obj.UTitle);
            Cls.AddParameter("RealName", obj.RealName);
            Cls.AddParameter("Birthday", obj.Birthday);
            Cls.AddParameter("URL", obj.URL);
            Cls.AddParameter("Jabber", obj.Jabber);
            Cls.AddParameter("Icq", obj.Icq);
            Cls.AddParameter("Msn", obj.Msn);
            Cls.AddParameter("Aim", obj.Aim);
            Cls.AddParameter("Yahoo", obj.Yahoo);
            Cls.AddParameter("Location", obj.Location);
            Cls.AddParameter("Signature", obj.Signature);
            Cls.AddParameter("DispTopics", obj.DispTopics);
            Cls.AddParameter("DispPosts", obj.DispPosts);
            Cls.AddParameter("EmailSetting", obj.EmailSetting);
            Cls.AddParameter("NotifyWithPost", obj.NotifyWithPost);
            Cls.AddParameter("Autonotify", obj.Autonotify);
            Cls.AddParameter("ShowSmiles", obj.ShowSmiles);
            Cls.AddParameter("ShowImg", obj.ShowImg);
            Cls.AddParameter("ShowImgSig", obj.ShowImgSig);
            Cls.AddParameter("ShowAvatars", obj.ShowAvatars);
            Cls.AddParameter("ShowSig", obj.ShowSig);
            Cls.AddParameter("Avartar", obj.Avartar);
            Cls.AddParameter("TimeZone", obj.TimeZone);
            Cls.AddParameter("Dst", obj.Dst);
            Cls.AddParameter("TimeFormat", obj.TimeFormat);
            Cls.AddParameter("DateFormat", obj.DateFormat);
            Cls.AddParameter("Language", obj.Language);
            Cls.AddParameter("Style", obj.Style);
            Cls.AddParameter("Gender", obj.Gender);
            return Cls.ExecuteNonQuery("sp_UserInfo_Update");
        }
        #endregion
    }

    public class DTOUsersInfo
    {
        public string UserId { get; set; }
        public string UTitle { get; set; }
        public string RealName { get; set; }
        public string URL { get; set; }
        public string Jabber { get; set; }
        public string Icq { get; set; }
        public string Msn { get; set; }
        public string Aim { get; set; }
        public string Yahoo { get; set; }
        public string Location { get; set; }
        public string Signature { get; set; }
        public int ? DispTopics { get; set; }
        public int ? DispPosts { get; set; }
        public int ? EmailSetting { get; set; }
        public int ? NotifyWithPost { get; set; }
        public int ? Autonotify { get; set; }
        public int ? ShowSmiles { get; set; }
        public int ? ShowImg { get; set; }
        public int ? ShowImgSig { get; set; }
        public int ? ShowAvatars { get; set; }
        public int ? ShowSig { get; set; }
        public float ? TimeZone { get; set; }
        public int ? Dst { get; set; }
        public string TimeFormat { get; set; }
        public string DateFormat { get; set; }
        public string Language { get; set; }
        public string Style { get; set; }
        public string Avartar { get; set; }
        public DateTime Birthday { get; set; }
        public string Gender { get; set; }
    }
}
